package mx.netbrain.util;

import java.util.Date;

import mx.netbrain.dao.PropertiesRepositoriesDao;
import mx.netbrain.dao.impl.PropertiesRepositoriesDaoImpl;
import mx.netbrain.model.PropertiesRepositories;
import mx.netbrain.model.Repositories;
import mx.netbrain.model.Status;
import mx.netbrain.model.TypeField;

public class RepositoriesDefaultUtil {

	private static PropertiesRepositories propertiesRepositories;
	private static Status status;
	private static TypeField typeField;
	private static PropertiesRepositoriesDao propertiesRepositoriesDao;

	public static void savePropertiesDefault(Repositories repositories) {
		// Campo para nombre
		propertiesRepositoriesDao = new PropertiesRepositoriesDaoImpl();
		propertiesRepositories = new PropertiesRepositories();
		status = new Status();
		typeField = new TypeField();
		propertiesRepositories.setLabel("Nombre: ");
		propertiesRepositories.setMandatory(true);
		propertiesRepositories.setName("name");
		propertiesRepositories.setRegistry(new Date());
		propertiesRepositories.setRepositories(repositories);
		propertiesRepositories.setSize(40);
		status.setId(1);
		propertiesRepositories.setStatus(status);
		typeField.setId(Long.parseLong("1"));
		propertiesRepositories.setTypeField(typeField);
		propertiesRepositoriesDao.save(propertiesRepositories);
		// Campo para descripcion
		propertiesRepositoriesDao = new PropertiesRepositoriesDaoImpl();
		propertiesRepositories = new PropertiesRepositories();
		status = new Status();
		typeField = new TypeField();
		propertiesRepositories.setLabel("Descripcion: ");
		propertiesRepositories.setMandatory(false);
		propertiesRepositories.setName("description");
		propertiesRepositories.setRegistry(new Date());
		propertiesRepositories.setRepositories(repositories);
		propertiesRepositories.setSize(200);
		status.setId(1);
		propertiesRepositories.setStatus(status);
		typeField.setId(Long.parseLong("3"));
		propertiesRepositories.setTypeField(typeField);
		propertiesRepositoriesDao.save(propertiesRepositories);
		// Campo para fecha
		propertiesRepositoriesDao = new PropertiesRepositoriesDaoImpl();
		propertiesRepositories = new PropertiesRepositories();
		status = new Status();
		typeField = new TypeField();
		propertiesRepositories.setLabel("Fecha: ");
		propertiesRepositories.setMandatory(false);
		propertiesRepositories.setName("date");
		propertiesRepositories.setRegistry(new Date());
		propertiesRepositories.setRepositories(repositories);
		propertiesRepositories.setSize(10);
		status.setId(1);
		propertiesRepositories.setStatus(status);
		typeField.setId(Long.parseLong("7"));
		propertiesRepositories.setTypeField(typeField);
		propertiesRepositoriesDao.save(propertiesRepositories);
		// Campo para version
		propertiesRepositoriesDao = new PropertiesRepositoriesDaoImpl();
		propertiesRepositories = new PropertiesRepositories();
		status = new Status();
		typeField = new TypeField();
		propertiesRepositories.setLabel("Versión: ");
		propertiesRepositories.setMandatory(false);
		propertiesRepositories.setName("version");
		propertiesRepositories.setRegistry(new Date());
		propertiesRepositories.setRepositories(repositories);
		propertiesRepositories.setSize(5);
		status.setId(1);
		propertiesRepositories.setStatus(status);
		typeField.setId(Long.parseLong("1"));
		propertiesRepositories.setTypeField(typeField);
		propertiesRepositoriesDao.save(propertiesRepositories);
	}

}
